home *** CD-ROM | disk | FTP | other *** search
/ Chip 2005 June / CHIP 2005-06.iso / program / e-is / OOo_2.0beta_tr_TR_WinIntel / openofficeorg2.cab / ooo2ms_docpr.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2005-03-16  |  8.7 KB  |  164 lines

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3.    The Contents of this file are made available subject to the terms of
  4.    either of the following licenses
  5.  
  6.           - GNU Lesser General Public License Version 2.1
  7.           - Sun Industry Standards Source License Version 1.1
  8.  
  9.    Sun Microsystems Inc., October, 2000
  10.  
  11.    GNU Lesser General Public License Version 2.1
  12.    =============================================
  13.    Copyright 2000 by Sun Microsystems, Inc.
  14.    901 San Antonio Road, Palo Alto, CA 94303, USA
  15.  
  16.    This library is free software; you can redistribute it and/or
  17.    modify it under the terms of the GNU Lesser General Public
  18.    License version 2.1, as published by the Free Software Foundation.
  19.  
  20.    This library is distributed in the hope that it will be useful,
  21.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  22.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  23.    Lesser General Public License for more details.
  24.  
  25.    You should have received a copy of the GNU Lesser General Public
  26.    License along with this library; if not, write to the Free Software
  27.    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  28.    MA  02111-1307  USA
  29.  
  30.  
  31.    Sun Industry Standards Source License Version 1.1
  32.    =================================================
  33.    The contents of this file are subject to the Sun Industry Standards
  34.    Source License Version 1.1 (the "License"); You may not use this file
  35.    except in compliance with the License. You may obtain a copy of the
  36.    License at http://www.openoffice.org/license.html.
  37.  
  38.    Software provided under this License is provided on an "AS IS" basis,
  39.    WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING,
  40.    WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
  41.    MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
  42.    See the License for the specific provisions governing your rights and
  43.    obligations concerning the Software.
  44.  
  45.    The Initial Developer of the Original Code is: Sun Microsystems, Inc.
  46.  
  47.    Copyright ┬⌐ 2002 by Sun Microsystems, Inc.
  48.  
  49.    All Rights Reserved.
  50.  
  51.    Contributor(s): _______________________________________
  52.    
  53.  -->
  54. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:w="http://schemas.microsoft.com/office/word/2003/wordml" xmlns:wx="http://schemas.microsoft.com/office/word/2003/auxHint" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:aml="http://schemas.microsoft.com/aml/2001/core" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:svg="http://www.w3.org/2000/svg" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:dom="http://www.w3.org/2001/xml-events" exclude-result-prefixes="office table style text draw svg   dc config xlink meta oooc dom ooo chart math dr3d form script ooow draw">
  55.     <xsl:template match="office:meta">
  56.         <o:DocumentProperties>
  57.             <o:Title>
  58.                 <xsl:value-of select="dc:title"/>
  59.             </o:Title>
  60.             <o:Subject>
  61.                 <xsl:value-of select="dc:subject"/>
  62.             </o:Subject>
  63.             <o:Keywords>
  64.                 <xsl:for-each select="meta:keywords/meta:keyword">
  65.                     <xsl:value-of select="."/>
  66.                     <xsl:if test="position()!=last()">, </xsl:if>
  67.                 </xsl:for-each>
  68.             </o:Keywords>
  69.             <o:Description>
  70.                 <xsl:value-of select="dc:description"/>
  71.             </o:Description>
  72.             <o:Category>
  73.                 <xsl:value-of select="meta:user-defined[@meta:name = 'Category']"/>
  74.             </o:Category>
  75.             <o:Author>
  76.                 <xsl:value-of select="meta:initial-creator"/>
  77.             </o:Author>
  78.             <o:LastAuthor>
  79.                 <xsl:value-of select="dc:creator"/>
  80.             </o:LastAuthor>
  81.             <o:Manager>
  82.                 <xsl:value-of select="meta:user-defined[@meta:name = 'Manager']"/>
  83.             </o:Manager>
  84.             <o:Company>
  85.                 <xsl:value-of select="meta:user-defined[@meta:name = 'Company']"/>
  86.             </o:Company>
  87.             <o:HyperlinkBase>
  88.                 <xsl:value-of select="meta:user-defined[@meta:name = 'HyperlinkBase']"/>
  89.             </o:HyperlinkBase>
  90.             <o:Revision>
  91.                 <xsl:value-of select="meta:editing-cycles"/>
  92.             </o:Revision>
  93.             <!-- PresentationFormat, Guid, AppName, Version -->
  94.             <o:TotalTime>
  95.                 <xsl:if test="meta:editing-duration">
  96.                     <xsl:variable name="hours">
  97.                         <xsl:choose>
  98.                             <xsl:when test="contains(meta:editing-duration, 'H')">
  99.                                 <xsl:value-of select="substring-before( substring-after( meta:editing-duration, 'PT'), 'H')"/>
  100.                             </xsl:when>
  101.                             <xsl:otherwise>0</xsl:otherwise>
  102.                         </xsl:choose>
  103.                     </xsl:variable>
  104.                     <xsl:variable name="minutes">
  105.                         <xsl:choose>
  106.                             <xsl:when test="contains(meta:editing-duration, 'M') and contains(meta:editing-duration, 'H')">
  107.                                 <xsl:value-of select="substring-before( substring-after( meta:editing-duration, 'H'), 'M')"/>
  108.                             </xsl:when>
  109.                             <xsl:when test="contains(meta:editing-duration, 'M')">
  110.                                 <xsl:value-of select="substring-before( substring-after( meta:editing-duration, 'PT'), 'M')"/>
  111.                             </xsl:when>
  112.                             <xsl:otherwise>0</xsl:otherwise>
  113.                         </xsl:choose>
  114.                     </xsl:variable>
  115.                     <xsl:value-of select="$hours * 60 + $minutes"/>
  116.                 </xsl:if>
  117.             </o:TotalTime>
  118.             <o:LastPrinted>
  119.                 <xsl:if test="meta:print-date">
  120.                     <xsl:value-of select="concat( meta:print-date, 'Z')"/>
  121.                 </xsl:if>
  122.             </o:LastPrinted>
  123.             <o:Created>
  124.                 <xsl:if test="meta:creation-date">
  125.                     <xsl:value-of select="concat( meta:creation-date, 'Z')"/>
  126.                 </xsl:if>
  127.             </o:Created>
  128.             <o:LastSaved>
  129.                 <xsl:if test="dc:date">
  130.                     <xsl:value-of select="concat( dc:date, 'Z')"/>
  131.                 </xsl:if>
  132.             </o:LastSaved>
  133.             <o:Pages>
  134.                 <xsl:value-of select="meta:document-statistic/@meta:page-count"/>
  135.             </o:Pages>
  136.             <o:Words>
  137.                 <xsl:value-of select="meta:document-statistic/@meta:word-count"/>
  138.             </o:Words>
  139.             <o:Characters>
  140.                 <xsl:value-of select="meta:document-statistic/@meta:character-count"/>
  141.             </o:Characters>
  142.             <!-- CharactersWithSpaces, Bytes, Lines -->
  143.             <o:Paragraphs>
  144.                 <xsl:value-of select="meta:document-statistic/@meta:paragraph-count"/>
  145.             </o:Paragraphs>
  146.         </o:DocumentProperties>
  147.         <o:CustomDocumentProperties>
  148.             <o:Editor dt:dt="string">
  149.                 <xsl:value-of select="meta:generator"/>
  150.             </o:Editor>
  151.             <o:Language dt:dt="string">
  152.                 <xsl:value-of select="dc:language"/>
  153.             </o:Language>
  154.             <xsl:for-each select="meta:user-defined">
  155.                 <!-- transfer strings to XML QName, necessary to convert several characters -->
  156.                 <xsl:element name="{concat( 'o:', translate(@meta:name,'.,| ~`!@#$%^&<>*()+=[]{};:"/\?','_'))}">
  157.                     <xsl:attribute name="dt:dt">string</xsl:attribute>
  158.                     <xsl:value-of select="."/>
  159.                 </xsl:element>
  160.             </xsl:for-each>
  161.         </o:CustomDocumentProperties>
  162.     </xsl:template>
  163. </xsl:stylesheet>
  164.